package com.sugar.subscribe.course.module.business.service.order;

import java.util.*;
import javax.validation.*;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import com.sugar.subscribe.course.module.business.controller.admin.order.vo.*;
import com.sugar.subscribe.course.module.business.controller.app.order.vo.*;
import com.sugar.subscribe.course.module.business.dal.dataobject.order.OrderDO;
import com.sugar.subscribe.course.framework.common.pojo.PageResult;
import com.sugar.subscribe.course.module.pay.api.order.dto.PayOrderSubmitRespDTO;

/**
 * 订单 Service 接口
 *
 * @author Ysugar
 */
public interface OrderService {

    /**
     * 更新订单
     *
     * @param updateReqVO 更新信息
     */
    void updateOrder(@Valid OrderSaveReqVO updateReqVO);

    void updateOrderAmount(OrderAmountUpdateReqVO amountUpdateReqVO);

    void orderAttendClass(OrderAttendClassReqVO amountUpdateReqVO);

    void backOrderCancel(Long id);

    /**
     * 删除订单
     *
     * @param id 编号
     */
    void deleteOrder(Long id);

    /**
    * 批量删除订单
    *
    * @param ids 编号
    */
    void deleteOrderListByIds(List<Long> ids);

    OrderDetailRespVO getOrder(Long id);

    /**
     * 获得订单
     *
     * @param id 编号
     * @return 订单
     */
    OrderDO getUserOrder(Long id, Long userId);

    /**
     * 获得订单
     *
     * @param id 编号
     * @return 订单
     */
    OrderDO getCoachOrder(Long id, Long coachId);

    /**
     * 获得订单分页
     *
     * @param pageReqVO 分页查询
     * @return 订单分页
     */
    PageResult<OrderRespVO> getOrderPage(OrderPageReqVO pageReqVO);

    // ======================================== 其它接口 ========================================

    void updateOrderPaid(String merchantOrderId, Long payOrderId);

    void updateOrderRefunded(String merchantRefundId, Long payRefundId);

    long autoConfirmOrder();

    long commissionSharingOrder();

    // ======================================== APP 接口 ========================================

    void appCreateOrder(AppOrderCreateReqVO createReqVO, Long userId);

    PayOrderSubmitRespDTO appUserPayOrder(Long id, Long userId, String clientIp);

    void appUpdateOrder(AppOrderUpdateReqVO updateReqVO, Long userId);

    PageResult<AppUserOrderPageRespVO> appGetUserOrderPage(AppOrderPageReqVO reqVO, Long userId);

    PageResult<AppUserOrderPageRespVO> appGetCoachOrderPage(AppOrderPageReqVO reqVO, Long coachId);

    void appUserCancelOrder(Long id, Long userId);

    void appCoachCancelOrder(Long id, Long coachId);

    void appDoneOrder(Long id, Long userId);

    void appCoachTakeOrder(Long id, Long coachId);

    void appCoachAttendClassOrder(AppOrderAttendClassReqVO appOrderAttendClassReqVO, Long coachId);

    AppOrderDetailRespVO appGetOrder(Long id);
}